package com.cai.btautolink;


import static android.util.Log.d;

import android.app.admin.DevicePolicyManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.hardware.input.InputManager;
import android.util.Log;
import android.view.InputDevice;

import java.util.Objects;

/**
 * 开机自启动应用
 */
public class BootBroadcastReceiver extends BroadcastReceiver {
    private static final String TAG = "BootBroadcastReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        d(TAG, "onReceive: ");
        if (Objects.equals(intent.getAction(), Intent.ACTION_BOOT_COMPLETED)) {
            context.startService(new Intent(context, MyService.class));
        } else if (Objects.equals(intent.getAction(), "com.cai.AUTO_LINK")) {
            context.startService(new Intent(context, MyService.class));
        }

    }

}
